<div id="sidebar">
    <div id="sidebar_title">sidebar</div>
    <ul class="sidebar_list">
        <?php foreach($categories as $category): ?>

        
            <li class="sidebar_item" style="margin-left:<?php echo $category['level']*10?>px">
                <a href="<?php echo $category['url']; ?>">
                    <?php echo $category['name']; ?>
                </a>
            </li>
    
        <?php endforeach; ?>
    </ul>
</div>